<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN">
<html>
<head>
<title>Beautify sql and syntax highlighting</title>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
    <meta name="generator" content="Doc-O-Matic" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <link rel="STYLESHEET" href="default.css" type="text/css" />

<script type="text/javascript" src="scripts.js"></script>
</head>
<body class="Element700" onload="onBodyLoadEx('frames.html', 'topic', 'Beautify_sql_and_syntax_highlighting.html');" onmousedown="onBodyMouseDown();">

<!-- Begin Popups -->

<!-- End Popups -->

<!-- Begin Page Header -->
<div class="Element710" id="areafixed">
<div class="Element94">
<em>You are here:</em> Using General SQL Parser &gt; <a href="Beautify_sql_and_syntax_highlighting.html" target="topic">Beautify sql and syntax highlighting</a></div>
<div class="Element92">
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td width="50%">
<div class="Element2">
<a href="contents.html" target="tocidx"><img src="btn_globals_contents_midblue.gif" border="0" alt="Contents" title="Contents" onmouseover="switchImage(this, 'btn_globals_contents_midblue_hover.gif');" onmouseout="switchImage(this, 'btn_globals_contents_midblue.gif');"></a><a href="idx.html" target="tocidx"><img src="btn_globals_index_midblue.gif" border="0" alt="Index" title="Index" onmouseover="switchImage(this, 'btn_globals_index_midblue_hover.gif');" onmouseout="switchImage(this, 'btn_globals_index_midblue.gif');"></a><a href="index.html" target="topic"><img src="btn_globals_home_midblue.gif" border="0" alt="Home" title="Home" onmouseover="switchImage(this, 'btn_globals_home_midblue_hover.gif');" onmouseout="switchImage(this, 'btn_globals_home_midblue.gif');"></a></div>
</td><td width="50%">
<div class="Element90">
<a href="Order_by_clause.html" target="topic"><img src="btn_prev_midblue.gif" border="0" alt="Previous" title="Previous" onmouseover="switchImage(this, 'btn_prev_midblue_hover.gif');" onmouseout="switchImage(this, 'btn_prev_midblue.gif');"></a><img src="btn_up_d.gif" border="0" alt="Up" title="Up"><a href="Source_Token_Types.html" target="topic"><img src="btn_next_midblue.gif" border="0" alt="Next" title="Next" onmouseover="switchImage(this, 'btn_next_midblue_hover.gif');" onmouseout="switchImage(this, 'btn_next_midblue.gif');"></a></div>
</td></tr></table><div class="Element5">
Beautify sql and syntax highlighting</div>
</div>
</div>

<!-- End Page Header -->

<!-- Begin Client Area -->
<div class="Element720" id="areascroll">
<div class="Element721">

<!-- Begin Page Content -->
<div class="Element58">
<a name="Description"></a><div class="Element11">
<div class="Element10">
<div class="Element15">
Beautify sql and syntax highlighting</div>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
After formatting sql, beautified sql was in plain text. There are 2 ways you can generate beautified sql in colored text with syntax highlighting, RTF and HTML output.&nbsp;</p>
<p class="Element10">

<ul class="Element633">
<li class="Element603">RTF output</li>
</ul>With this output, colored sql can be viewed in any editor that supported rtf format,&nbsp;</p>
<p class="Element10">
such as writer and ms word. and you can use microsoft Rich Editor component in your app&nbsp;</p>
<p class="Element10">
to add syntax highlighting function with RTF output.&nbsp;</p>
<p class="Element10">

<ul class="Element633">
<li class="Element603">HTML output</li>
</ul>With this output, colored sql can be published in website, blog, wiki and so on.&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
The default font of output is Courier New, and it works fine. Please don't change this font although you can set new font by using gFmtOpt.HighlightingFontname.&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
The default font size of output is 10, and it can be changed by setting new value to gFmtOpt.HighlightingFontsize.&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
HighlightingFontname and HighlightingFontsize apply to whole output, and you can also customize each token with different color and style by using&nbsp;</p>
<p class="Element10">
&nbsp;</p><div class="Element13"><div class="Element12"><pre class="Element12">TLzHighlighterAttributes.SetForegroundInRGB
TLzHighlighterAttributes.StyleItalic
TLzHighlighterAttributes.StyleBold
TLzHighlighterAttributes.StyleStrikeout
TLzHighlighterAttributes.StyleUnderline</pre></div></div>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
Below are all kinds of token type that you can used to customize color and style.&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkComment_dh] -- this is double hyphen comment&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkComment_ss] /* this is multi line comment */&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkIdentifer] identifier:&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkstandardkeyword] keyword&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkNumber] number:&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkDatatype] datatype :&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkFunction] user defined function:&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkBuiltInFunction] database vendor built in function:&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkSymbol] all kinds of operator&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkSQString] String&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfksqlvar] sql variable&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkOpenBracket] (&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkCloseBracket] )&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkmssqlst1] sql server sp:&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkmssqlsystemvar] sql server system variable&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkoraclesqlplus] oracle sql plus command&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkoracleexception] oracle exception:&nbsp;</p>
<p class="Element10">
gFmtOpt.HighlightingElements[sfkbindvar] bind variable, :bindvar&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
for more detailed information about syntax highlighting of formatted sql, please check this demo&nbsp;</p>
<p class="Element10">
<span class="Element145">http://www.sqlparser.com/dl/samples/syntaxhighlighting.zip</span>&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
Below are some color in RGB format that can be used by TLzHighlighterAttributes.SetForegroundInRGB.&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
&nbsp;</p>
<p class="Element10">
Black = #000000&nbsp;</p>
<p class="Element10">
Maroon = #000080&nbsp;</p>
<p class="Element10">
Green = #008000&nbsp;</p>
<p class="Element10">
Olive = #008080&nbsp;</p>
<p class="Element10">
Navy = #800000&nbsp;</p>
<p class="Element10">
Purple = #800080&nbsp;</p>
<p class="Element10">
Teal = #808000&nbsp;</p>
<p class="Element10">
Gray = #808080&nbsp;</p>
<p class="Element10">
Silver = #C0C0C0&nbsp;</p>
<p class="Element10">
Red = #0000FF&nbsp;</p>
<p class="Element10">
Lime = #00FF00&nbsp;</p>
<p class="Element10">
Yellow = #00FFFF&nbsp;</p>
<p class="Element10">
Blue = #FF0000&nbsp;</p>
<p class="Element10">
Fuchsia = #FF00FF&nbsp;</p>
<p class="Element10">
Aqua = #FFFF00&nbsp;</p>
<p class="Element10">
LtGray = #C0C0C0&nbsp;</p>
<p class="Element10">
DkGray = #808080&nbsp;</p>
<p class="Element10">
White = #FFFFFF&nbsp;</p>
<p class="Element10">
MoneyGreen=#$C0DCC0&nbsp;</p>
<p class="Element10">
SkyBlue = #F0CAA6&nbsp;</p>
<p class="Element10">
Cream = #F0FBFF&nbsp;</p>
<p class="Element10">
MedGray = #A4A0A0</p></div>
</div>
</div>
<!-- End Page Content -->

<!-- Begin Page Footer -->
<div class="Element93">
<table width="100%" cellspacing="0" cellpadding="0">
<tr><td width="100%">
<div class="Element3">
Gudu software http://www.sqlparser.com</div>
</td></tr><tr><td width="100%">
<div class="Element97">
Send <a href="#" onclick="sendFeedback('info@sqlparser.com', 'Documentation Feedback', 'Project: General SQL Parser Help file%0ATopic ID: Beautify sql and syntax highlighting%0ATitle: Beautify sql and syntax highlighting');">comments</a> about this topic.</div>
</td></tr></table></div>

<!-- End Page Footer -->
</div>
</div>

<!-- End Client Area -->
</body></html>